/*
 *  Copyright 2011-2012 Redia A/S
 * 
 *  This file is part of Redias Android Utilities.
 *
 *  Redias Android Utilities is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Redias Android Utilities is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Redias Android Utilities.  If not, see <http://www.gnu.org/licenses/>.
 */
package dk.redia.lib.utils;

public abstract class AppConfiguration {

	private static AppConfiguration instance;
	
	public static void setAppConfiguration(AppConfiguration c) {
		instance = c;
	}
	
	public static AppConfiguration getInstance() {
		return instance;
	}
	
	/**
	 * Determine whether or not we are in production mode.
	 * May change at runtime
	 * 
	 * @return
	 */
	public abstract boolean getProductionMode();
	
	/**
	 * Sets whether we are currently in production mode.
	 * Implementations should make sure to remove appropriate state
	 * when switching to and from production mode at runtime.
	 */
	public abstract void setProductionMode(boolean productionMode);
	
	/**
	 * Retrieves the customer id currently in use
	 * 
	 * @return The configured customer id
	 */
	public abstract String getCustomerId();

	/**
	 * Retrieves the gallery id currently in use.
	 * 
	 * @return The configured gallery id
	 */
	public abstract String getGalleryId();

	/**
	 * Retrieves the current API key.
	 * The API key is used to access the image caching/scaling service
	 * 
	 * @return The configured API key
	 */
	public abstract String getApiKey();	

	/**
	 * Retrieves the number of seconds between infogalleri model
	 * automated refreshes. A sensible value should be no less than 3600
	 * 
	 * @return The configured infogalleri model refresh interval
	 */
	public abstract int getInfoGalleriModelRefreshInterval();	
	
	/**
	 * Get the language abbreviation used to select appropriately translated content
	 * 
	 * @return The ISO 629-1 language abbreviation
	 */
	public abstract String getContentLanguage();
	
	/**
	 * Update the current language abbreviation
	 * 
	 * @param language The ISO 629-1 language abbreviation to use
	 */
	public abstract void setContentLanguage(String language);
	
	/**
	 * Set the current UI language to use
	 * 
	 * @param language The ISO 629-1 language abbreviation to use
	 */
	public abstract void setUiLanguage(String language);

	/**
	 * Get the language abbreviation to use in the UI
	 * 
	 * @return The ISO 629-1 language abbreviation
	 */
	public abstract String getUiLanguage();
	
	/**
	 * Get the configured InfoGalleri XML-RPC endpoint URL
	 * 
	 * @return A string defining the URL
	 */
	public abstract String getInfoGalleriXmlRpcUrl();

}
